package buffer;

import java.util.Objects;

public class Student {
    private String name ;
    private String school ;
    private String adress ;
    private   int  age;

    public Student() {
    }

    public Student(String name, String school, String adress, int age) {
        this.name = name;
        this.school = school;
        this.adress = adress;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }

    public String getAdress() {
        return adress;
    }

    public void setAdress(String adress) {
        this.adress = adress;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return age == student.age &&
                Objects.equals(name, student.name) &&
                Objects.equals(school, student.school) &&
                Objects.equals(adress, student.adress);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, school, adress, age);
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", school='" + school + '\'' +
                ", adress='" + adress + '\'' +
                ", age=" + age +
                '}';
    }
}
